Question: Dave rode 30 miles at 10 miles per hour and 10 miles at 30 miles per hour. What was his average speed, in miles per hour, for the entire ride?
Answer: Dave rode a total of $40$ miles.  The $30$ mile segment took $\frac{30}{10}=3$ hours, while the $10$ mile segment took $\frac{10}{30}=\frac{1}{3}$ hours, so the full ride took $3+\frac{1}{3}=\frac{10}{3}$ hours.

So the average speed was  $\frac{40}{\frac{10}{3}}=\boxed{12}$ miles per hour.